<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateUserTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('user', function (Blueprint $table) {
            $table->increments('id');
            $table->string('name')->nullable()->comment('姓名');
            $table->string('phone')->nullable()->index()->comment('手机号');
            $table->string('password')->nullable()->comment('密码');
            $table->boolean('gender')->default(0)->comment('性别 0未知  1男  2女');
            $table->string('avatar')->nullable()->comment('头像');
            $table->unsignedTinyInteger('reg_type')->default(0)->comment(' 注册来源    0微信   1后台');
            $table->string('identification', 18)->nullable()->comment('身份证号码');
            $table->unsignedInteger('service_id')->nullable()->comment('归属站点');
            $table->unsignedTinyInteger('status')->default(1)->comment(' 状态    0未启用   1正常');
            $table->unsignedTinyInteger('send_type')->default(0)->comment('配送方式  0自提  1派送');
            $table->string('appointment_time')->nullable()->comment('预约时间');
            $table->string('home_address')->nullable()->comment('家地址');
            $table->string('company_address')->nullable()->comment('公司地址');
            $table->string('nickname')->nullable()->comment('昵称');
            $table->string('wx_openid')->nullable()->comment('微信openid');
            $table->string('wx_info')->nullable()->comment('微信的用户信息');
            $table->timestamps();
            $table->softDeletes();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('user');
    }
}
